package com.reebake.ideal.user.controller.client;

import cn.hutool.core.bean.BeanUtil;
import com.reebake.ideal.user.client.UserInfoClient;
import com.reebake.ideal.user.entity.UserInfoDTO;
import com.reebake.ideal.user.service.UserInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequiredArgsConstructor
@RequestMapping("/client/user/info")
public class UserInfoClientController implements UserInfoClient {
    private final UserInfoService userInfoService;

    @Override
    public UserInfoDTO queryByUserId(String userId) {
        return BeanUtil.copyProperties(userInfoService.getById(userId), UserInfoDTO.class);
    }

}
